from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import (
    PermissionCategoryViewSet,
    PermissionViewSet,
    RoleViewSet,
    UserRoleViewSet
)

# 创建路由器
router = DefaultRouter()

# 注册ViewSet
router.register(r'categories', PermissionCategoryViewSet, basename='permission-categories')
router.register(r'permissions', PermissionViewSet, basename='permissions')
router.register(r'roles', RoleViewSet, basename='roles')
router.register(r'user-roles', UserRoleViewSet, basename='user-roles')

# URL配置
urlpatterns = [
    path('', include(router.urls)),
]
